// components/disinfection-list.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    ptbss: {
      type: Object,
      value: {
        id: '0',
        title: '',
        picture:'',
        over_num:1,
        checked: false
      }
    },
    index:{
      type:Number,
      value:0
    },
    editable:{
      type:Boolean,
      value:false,
    },
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    //选中和取消
    onDfTap(e) {
      let { editable, ptbss } = this.data

      let checked = ptbss.checked;
      checked = !checked;

      let ptbss2 = Object.assign({}, ptbss, { checked });

      if (!editable) return
      this.setData({
        ptbss: ptbss2
      })
      this.triggerEvent('custometapdf', this.data.ptbss);  //把checked更新到页面中

    },
    getdfNum(e) {
      let { ptbss} = this.data;

      let over_num = ptbss.over_num;
      over_num = e.detail.value;

      let ptbss2 = Object.assign({}, ptbss, { over_num });

      this.setData({
        ptbss: ptbss2
      })
      this.triggerEvent('customeGetNum',this.data.ptbss);   //input的值更新到提交后的页面中
    },
    getRemarks(e){
      let { ptbss } = this.data;

      let sub_note = ptbss.sub_note;
      sub_note = e.detail.value;

      let ptbss2 = Object.assign({}, ptbss, { sub_note });

      this.setData({
        ptbss: ptbss2
      })
      this.triggerEvent('customeGetRemarks', this.data.ptbss);   //input的值更新到提交后的页面中
    }
  }
})
